Skip to content

Conversation

@ids1024
Copy link
Member

@ids1024 ids1024 commented Sep 9, 2025

Iterate over surfaces that have an exclusive zone first, then other surfaces. This allows a surface that doesn't have an exclusive zone to be moved or resized for a later surface that does have an exclusive zone. As is probably desired.

This does help with a test client, but not with the client I was trying to fix; so I need to do a bit more testing here...

@ids1024
Copy link
Member Author

ids1024 commented Oct 8, 2025

Looks like the handling of the edge for exclusive zones there isn't quite right already.

                      x if x.contains(Anchor::TOP) && x.contains(Anchor::BOTTOM) => {
                            zone.size.w -= amount;
                            if x.contains(Anchor::LEFT) {
                                zone.loc.x += amount;
                                zone.loc.x += data.margin.left;
                                zone.size.w -= data.margin.left;
                            }
                            if x.contains(Anchor::RIGHT) {
                                zone.size.w -= data.margin.right
                            }
                        }

This case appears before the x == Anchor::all() case; so presumably this branch would be hit, and the Anchor::Left case inside it instead.

We could have a function to determine the exclusive edge, if any. And also add support for version 5 of the protocol supporting an explicit exclusive edge: https://gitlab.freedesktop.org/wlroots/wlr-protocols/-/merge_requests/123

This simplifies the match for anchors, and should correct the behavior
for things like anchoring all edges.

I believe previously the `x == Anchor::all()` case would never be
reached, since the `x.contains(Anchor::TOP) && x.contains(Anchor::BOTTOM)`
condition would also be true. Also the behavior is wrong; the spec says
to treat this like `ExclusiveZone::Neutral`.

This should now behave as defined by the spec.
Use the exclusive edge provided by the request if present. Otherwise,
fallback to the implied edge based on anchors.
Iterate over surfaces that have an exclusive zone first, then other
surfaces. This allows a surface that doesn't have an exclusive zone to
be moved or resized for a later surface that does have an exclusive
zone. As is probably desired.
@ids1024 ids1024 force-pushed the layer-shell-arrange branch from 9668eae to 3290055 Compare October 9, 2025 02:00
@ids1024 ids1024 changed the title wayland/layer: In arrange(), handle exclusive zone surfaces first wayland/layer: Exclusive edge fix, protocol version 5, arrange order Oct 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants